/**
 * Created by yuji on 2015/10/29.
 */

var fs = require('fs');
var util = require('../lib/util');

var fileObj =  fs.readFileSync('a.css').toString();

var urlCss = /url\(\s*[^(]*\)/g;
var content = fileObj.replace(urlCss,function(value){
    value = value.replace(/'/g,'').replace(/"/g,'').replace(/\s/g,'');
    var name = value.slice(4,-1);
    var resolvedPath = util.parsePath("a.css", name);
    //var resolvedPath = name;
    return 'url(<%- data["'+ resolvedPath + '"]%>)';
})

console.log(content);
